import * as React from 'react';
import { Alert } from '@aws-amplify/ui-react';
import { Demo } from '@/components/Demo';
import { AlertPropControls } from './AlertPropControls';
import { useAlertProps } from './useAlertProps';
import { demoState } from '@/utils/demoState';
const propsToCode = (props) => {
return (
`
${props.body}
`
);
};
const defaultAlertProps = {
isDismissible: false,
hasIcon: true,
heading: 'Alert heading',
body: 'This is the alert message',
};
export const AlertDemo = () => {
const alertProps = useAlertProps(
demoState.get(Alert.displayName) || defaultAlertProps
);
return (
}
>
{alertProps.body}
);
};